Load data
raw <-
bind_rows(
read_excel(file.path("data", "20170727__data_export.xlsx"))
) %>%
select(File, Nr., Start, Rt, End, # filename and retention times
Ampl44=`Ampl 44`, Ampl45=`Ampl 45`, # amplitudes
Area44=`rIntensity 44`, Area45=`rIntensity 45`, # areas
Intensity=`Intensity All`, #peak intensities
R13C = `R 13C/12C`, d13C = `13C/12C` # ratio and delta values
)
Map peaks
### CHANGE MAPPING FILE NAME ###
data_matched <- map_peaks(raw, metadata_file = file.path("metadata", "smoky_hollow_peaks_July27.xlsx"), quiet = FALSE)
## INFO: 627 peaks in 26 files successfully assigned.
## WARNING: 95 peaks are unassigned or missing
## # A tibble: 95 × 22
## File Nr. Start Rt End
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 1387__170725_PTV_2uL_OG038 Ad.dxf NA NA NA NA
## 2 1387__170725_PTV_2uL_OG038 Ad.dxf NA NA NA NA
## 3 1387__170725_PTV_2uL_OG038 Ad.dxf NA NA NA NA
## 4 1387__170725_PTV_2uL_OG038 Ad.dxf 13 2019.149 2024.374 2030.435
## 5 1387__170725_PTV_2uL_OG038 Ad.dxf 18 2422.310 2426.281 2432.760
## 6 1387__170725_PTV_2uL_OG038 Ad.dxf NA NA NA NA
## 7 1387__170725_PTV_2uL_OG038 Ad.dxf NA NA NA NA
## 8 1388__170725_PTV_2uL_OG041 Ad.dxf NA NA NA NA
## 9 1388__170725_PTV_2uL_OG041 Ad.dxf NA NA NA NA
## 10 1388__170725_PTV_2uL_OG041 Ad.dxf NA NA NA NA
## # ... with 85 more rows, and 17 more variables: Ampl44 <dbl>,
## # Ampl45 <dbl>, Area44 <dbl>, Area45 <dbl>, Intensity <dbl>, R13C <dbl>,
## # d13C <dbl>, compound <chr>, is_ref_peak <chr>, map <chr>,
## # Rt_target <dbl>, type <chr>, process <chr>, notes <chr>, depth <dbl>,
## # n_matches <dbl>, n_overlapping <dbl>
Add standard values
standards <- read_excel(file.path("metadata", "gc_irms_indiana_A6.xlsx"))
data_w_stds <- data_matched %>%
filter(type == "standard", is_ref_peak == "no") %>%
left_join(standards, by = "compound") %>%
mutate(is_std = !is.na(true.d13C) | !is.na(true.d2H))
isotope values check by rentention time
data_w_stds %>%
ggplot() +
aes(x = Rt, y = d13C, color = File) +
geom_point() +
theme_bw() +
theme(legend.position = "none")

ggplotly(ggplot2::last_plot() + theme(legend.position = "none"))
peak intensities check by rentention time
data_w_stds %>%
ggplot() +
aes(x = Rt, y = Intensity, color = File) +
geom_point() +
theme_bw() +
theme(legend.position = "none")

ggplotly(ggplot2::last_plot() + theme(legend.position = "none"))
Data
message(sprintf("Infered reference tank isotopic composition: %.2f +/- %.2f",
std_corrections$delta_ref_CO %>% mean(),
std_corrections$delta_ref_CO %>% sd()))
## Infered reference tank isotopic composition: -9.39 +/- 1.17
# simplifed offset=ref gas correction (TODO: consider signal strengh (linearity correct), consider drift and evaluate standards between samples rather than average)
offset_avg <- std_corrections$offset %>% mean()
slope_avg <- std_corrections$slope %>% mean()
All
data_matched %>%
filter(type == "sample", is_ref_peak == "no") %>%
mutate(d13C.corrected = (d13C - offset_avg)/(slope_avg)) %>%
ggplot() +
aes(compound, y = d13C.corrected, color = File) +
geom_point() +
theme(axis.text.x = element_text(angle = 90))

ggplotly(ggplot2::last_plot() + theme(legend.position = "none"))
Against depth
data_matched %>%
filter(type == "sample", is_ref_peak == "no") %>%
mutate(d13C.corrected = (d13C - offset_avg)/(slope_avg)) %>%
ggplot() +
aes(x = depth, y = d13C.corrected, color = File, size = Area44) +
geom_point() +
scale_x_reverse() +
facet_wrap(~compound, scales = "free") +
coord_flip()

ggplotly(ggplot2::last_plot() + theme(legend.position = "none"))